<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>拒绝发布游记日报管理</title>
    <#include "../common/header.ftl"/>
    <#include "../common/page.ftl"/>

    <script type="text/javascript">
        $(function () {
            $('.changeBtn').click(function () {
                //获取选中的id
                var id = $(this).data('id');
                //获取该选项的id值
                var status = $(this).data('status');
                // 发送请求修改游记日报状态
                $.post('/daily/changeStatus.do',{id:id,status:status},function (data) {
                    console.log(data);
                    if(data.success){
                            $.messager.confirm("温馨提示","操作成功",function () {
                                window.location.reload();
                            })
                        }else {
                            $.messager.alert("温馨提示","操作失败");
                        }
                });
            });

            $('.lookBtn').click(function() {
               var dailyId =  $(this).data('id');
                $.get('/daily/getDailyContentById.do',{dailyId:dailyId},function (data) {
                    console.log(data.content);
                    $('#showModal .modal-body').html(data.content);
                });
                $('#showModal').modal('show');
            });
        });
    </script>
    <style type="text/css">
        #showModal img {
            width: 100%;
        }
        #showModal .modal-body{
            max-height: 600px;
            overflow-y: auto;
        }
    </style>
</head>

<body>
<div class="container">
<#include "../common/top.ftl"/>
    <div class="row">
        <div class="col-sm-3">
		<#assign currentMenu = "daily_refuse" />
				<#include "../common/menu.ftl" />
        </div>
        <div class="col-sm-9">
            <div class="page-header">
                <h3>拒绝发布游记日报管理</h3>
            </div>
            <div class="row">
                <!-- 提交分页的表单 -->
                <form id="searchForm" class="form-inline" method="post" action="/daily/refuseList.do">
                    <input type="hidden" name="currentPage" id="currentPage" value="1"/>
                    <div class="form-group">
                    </div>
                    <div class="form-group">
                        <label>关键字</label>
                        <input class="form-control" type="text" name="keyword" placeholder="请输入标题/昵称"  value="${(qo.keyword)!''}">
                    </div>
                    <div class="form-group">
                        <button id="query" type="button" class="btn btn-success"><i class="icon-search"></i> 查询</button>
                    </div>
                </form>
            </div>
            <div class="row">
                <table class="table">
                    <thead>
                    <tr>
                        <th>标题</th>
                        <th>封面</th>
                        <th>作者</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
					<#list result.list as vo>
                    <tr>
                        <td>${vo.title!}</td>
                        <td><img src="${vo.coverUrl!}" style="width: 60px" alt=""></td>
                        <td>${vo.author.nickName!}</td>
                        <td>${vo.statusDisplay}</td>
                        <td>
                            <a href="javascript:;" class="btn btn-success changeBtn" data-id="${vo.id}" data-status="1">重新审核</a>
                            <a href="javascript:;" class="btn btn-primary lookBtn" data-id="${vo.id}">查看文章</a>
                        </td>
                    </tr>
					</#list>
                    </tbody>
                </table>

                <div style="text-align: center;">
                    <ul id="pagination" class="pagination"></ul>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="showModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">游记日报详情</h4>
            </div>
            <div class="modal-body">
                <#--游记日报内容-->
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">确定</button>
            </div>
        </div>
    </div>
</div>
</body>
</html>